@{
    ViewData["Title"] = "Logup";
}
<form id="logUpForm" asp-action="LogupPost" asp-controller="Login" method="post" class="form-horizontal" role="form">
<div style="margin-top:20px;height:100%;width:100%">
    账号：<input type="text" name="userName" minlength="2" id="userName" required/>
    <br/>
    <br/>
    密码：<input type="password" name="PassWord" id="pwd" required/>
    <br/>
    <br/>
    确认密码：<input type="password" id="pwdAgin"/>
    <!-- <br/>
    <br/>
    头像：<input type="button" value="上传"/> -->
    <br/>
    <br/>
    <input type="submit" value="注册" onclick="subMit()"/>

</div>
</form>
<script>
    
function subMit(){
    $('#logUpForm').validate({
        submitHandler: function(form,e) {
            // do other things for a valid form
            //$(form).ajaxSubmit();
            $.ajax({
                url:"/Login/LogupPost",    
                data:$(form).serialize(),
                type:'post',
                dataType:'json',
                success:function(data){
                    if(data){
                        alert(data.msg)
                    }else{
                        alert('失败！')
                    }

                }
            })
        e.preventDefault();
    }
 });

}
</script>
